package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.SaleOrderDeliveryMapper;
import com.ly.heart.domain.SaleOrderDeliveryEntity;
import javax.annotation.Resource;
import com.ly.heart.service.ISaleOrderDeliveryService;

/**
 * 销售订单交货明细Service业务层处理
 * 
 * @author wutao
 * @date 2024-06-30
 */
@Service
public class SaleOrderDeliveryServiceImpl extends ServiceImpl<SaleOrderDeliveryMapper, SaleOrderDeliveryEntity> implements ISaleOrderDeliveryService {

    @Resource
    private SaleOrderDeliveryMapper saleOrderDeliveryMapper;

    /**
     * 查询销售订单交货明细
     * 
     * @param id 销售订单交货明细ID
     * @return 销售订单交货明细
     */
    @Override
    public SaleOrderDeliveryEntity selectSaleOrderDeliveryById(String id)
    {
        return saleOrderDeliveryMapper.selectSaleOrderDeliveryById(id);
    }

    /**
     * 查询销售订单交货明细列表
     * 
     * @param saleOrderDelivery 销售订单交货明细
     * @return 销售订单交货明细
     */
    @Override
    public List<SaleOrderDeliveryEntity> selectSaleOrderDeliveryList(SaleOrderDeliveryEntity saleOrderDelivery)
    {
        return saleOrderDeliveryMapper.selectSaleOrderDeliveryList(saleOrderDelivery);
    }

    /**
     * 新增销售订单交货明细
     * 
     * @param saleOrderDelivery 销售订单交货明细
     * @return 结果
     */
    @Override
    public int insertSaleOrderDelivery(SaleOrderDeliveryEntity saleOrderDelivery)
    {
        saleOrderDelivery.setCreateTime(DateUtils.getNowDate());
        return saleOrderDeliveryMapper.insertSaleOrderDelivery(saleOrderDelivery);
    }

    /**
     * 修改销售订单交货明细
     * 
     * @param saleOrderDelivery 销售订单交货明细
     * @return 结果
     */
    @Override
    public int updateSaleOrderDelivery(SaleOrderDeliveryEntity saleOrderDelivery)
    {
        saleOrderDelivery.setUpdateTime(DateUtils.getNowDate());
        return saleOrderDeliveryMapper.updateSaleOrderDelivery(saleOrderDelivery);
    }

    /**
     * 批量删除销售订单交货明细
     * 
     * @param ids 需要删除的销售订单交货明细ID
     * @return 结果
     */
    @Override
    public int deleteSaleOrderDeliveryByIds(String[] ids)
    {
        return saleOrderDeliveryMapper.deleteSaleOrderDeliveryByIds(ids);
    }

    /**
     * 删除销售订单交货明细信息
     * 
     * @param id 销售订单交货明细ID
     * @return 结果
     */
    @Override
    public int deleteSaleOrderDeliveryById(String id)
    {
        return saleOrderDeliveryMapper.deleteSaleOrderDeliveryById(id);
    }
}
